import JsonData from "../../Json.js";

Component({
    properties: {
        receivedTimeArr: Array
    },
    data: {
        contactClasses: [ {
            title: "新的朋友",
            imgUrl: "newfriends"
        }, {
            title: "群聊",
            imgUrl: "group"
        }, {
            title: "标签",
            imgUrl: "tag"
        }, {
            title: "公众号",
            imgUrl: "subscription"
        } ],
      contactsList: JsonData.contactsList
    },
    attached: function() {
      let contactsList = this.data.contactsList;
      let user = wx.getStorageSync('user');
      contactsList.splice(1, 0, user);
        this.setData({
          contactsList: contactsList
        });
    },
    methods: {
      toInformation: function (e) {
        let { url, wechat } = e.currentTarget.dataset;
        if (wechat){
          wx.navigateTo({ url: `${url}&wechat=${wechat}` })
        }
      },
    }
});